if __name__ == '__main__':
    str1 = "gbrbgiab"
    str2 = "frg"

    #字符串切片操作
    str3 = str1[0:3]
    print(str3)
    #从指定位置切到最后
    str4 = str1[2:]
    print(str4)
    #指定切割的步伐
    str5 = str1[0:3:2]
    print(str5)
    #获取长度
    print(len(str1))
    #获取第四个字符
    print(str1[3])
    #分割操作
    strA = "张国荣,陈冠希,曹仕杰"
    names = strA.split(",")

    print(names)
    print(names[2])

    strB = strA.replace(","," ")
    print(strB)

    result = strA.find("张")
    print(result)
    result2 = strA.rfind("张")
    print(result2)

    #判断字符串是否为纯数字
    strX = "13548343515374"
    print(strX.isdigit())